#ifndef _SIANOSPI_H_
#define _SIANOSPI_H_


#include <windows.h>
#include <pm.h>

#include "BusDrvIf.h"
#include "SianoDMA_API.h"
#include "smsspicommon.h"

#include "dbg_prn.h"

/************************************************************************/
/* Debug Zones definitions.                                             */
/************************************************************************/

#if 0
#define ZONE_ERROR            1

#define ZONE_INIT            1

#define ZONE_INFO            1

#define DBGMSG                RETAILMSG
#endif

/************************************************************************/

#define PXA27x

/////////////////////////////////////////////////
//for posting RETAILMSG for debug - remove remark
//#define POSTDEBUGMSG
/////////////////////////////////////////////////

typedef enum _CLIENTTYPE {ClientTypeNone,ClientTypeControl,ClientTypeData,ClientTypeIpData}CLIENTTYPE;

#ifndef RX_PACKET_SIZE
    #define RX_PACKET_SIZE    0x1000
#endif
#define NUM_OF_RX_PACKES    100//48//24//4
#define SMM100_HDR_SIZE    8
#define SPI_PREAMBLE 0x7EE75AA5//0xA55AE77E//0xA5, 0x5A, 0xE7, 0x7E,//Preamble in little endian
#define SPI_PREAMBLE_REVERSE 0xA55AE77E
#define SPI_PREAMBLE_SIZE 4



typedef struct DEVICE_DMA_SERVICE_S
{
    HMODULE                hdl;
    LPVOID                rxDmaDevice;
    LPVOID                txDmaDevice;
    DMA_SetUpChannelF    dmaSetUpChannel;
    DMA_ConfigChannelF    dmaConfigChannel;
    DMA_RemoveChannelF    dmaRemoveChannel;
}DEVICE_DMA_SERVICE_ST;

#define MAX_REG_PATH_SIZE 100
                                        //adapter//Buff//Len



typedef struct _SPIDEVICEEXTENSION
{

    struct spi_dev        dev;
    void (*Callback)(PCHAR buf, int len) ;
    BOOL                 PaddingAllowed;
    rx_buffer_st        rxbuf;
    char                 *txbuf;
    unsigned long        txbuf_phy_addr;
    HANDLE                WriteOperation;
    HANDLE                transferMsgQueue;
    HANDLE                transferThread;
    HANDLE                performanceThread;
    PVOID                phyDrv;
    HANDLE                hSmsGenDrv;                //GenDriver handle.
    BD_ReadCBFunc        pBD_ReadCBFunc;
    BOOL                novaDevice;
    CEDEVICE_POWER_STATE    powerState;
    DWORD                    hBDContext;
}SPIDEVICEEXTENSION, *PSPIDEVICEEXTENSION;




#endif
